# _*_ coding: utf-8 _*_
# @Time : 2024-01-22 22:28
# @Author : wf
import openpyxl.cell.cell
from openpyxl import Workbook
from openpyxl.worksheet.worksheet import Worksheet

# 创建workboob
wb = Workbook()
# 创建 sheet页
ws: openpyxl.worksheet.worksheet.Worksheet = wb.active

x = 1
for i in range(1, 11):
    for j in range(1, 11):
        ws.cell(i, j , str(x))
        x += 1

# 合并单元格
# ws.merge_cells('b2:d4')
# 取消合并
# ws.unmerge_cells('b2:d4')

# 插入行 和 列
# ws.insert_rows(1, 2)
# ws.insert_cols(2, 3)

# 删除 行和列
# ws.delete_rows(1, 2)
# ws.delete_cols(2, 3)

# 移动单元格
ws.move_range('b3:d5', 2, -1)

# 保存单元格
wb.save('test.xlsx')
